#!/usr/bin/python2.7
#coding=utf8

import datetime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Index, Sequence, BigInteger, Integer, DateTime, Numeric, String, Unicode, UnicodeText, Text

Base = declarative_base()

class CVM_HGSJ_MONTH(Base):
    __tablename__ = 'cvm_hgsj_month'
    id = Column(Integer, Sequence("seq_cvm_hgsj_month"), primary_key=True)
    date = Column(String(6), nullable=False)
    cpi = Column(Numeric(32,8), nullable=True)
    m0 = Column(Numeric(32,8), nullable=True)
    m1 = Column(Numeric(32,8), nullable=True)
    m2 = Column(Numeric(32,8), nullable=True)
    splsjgzs = Column(Numeric(32,8), nullable=True) ##商品零售价格指数
    pmi = Column(Numeric(32, 8), nullable=True)  ##PMI
    xjltwttb = Column(Numeric(32, 8), nullable=True)  ##橡胶轮胎外胎月同比
    dyxjltwt = Column(Numeric(32, 8), nullable=True)  ##当月橡胶轮胎外胎
    xjltwtljtb = Column(Numeric(32, 8), nullable=True)  ##橡胶轮胎外胎累计同比
    ljxjltwt = Column(Numeric(32, 8), nullable=True)  ##累计橡胶轮胎外胎
    qydytb = Column(Numeric(32, 8), nullable=True)  ##汽油当月同比
    dyqy = Column(Numeric(32, 8), nullable=True)  ##当月汽油
    qyljtb = Column(Numeric(32, 8), nullable=True)  ##汽油累计同比
    qylj = Column(Numeric(32, 8), nullable=True)  ##汽油累计
    cydytb = Column(Numeric(32, 8), nullable=True)  ##柴油当月同比
    dycy = Column(Numeric(32, 8), nullable=True)  ##当月柴油
    cyljtb = Column(Numeric(32, 8), nullable=True)  ##柴油累计同比
    cylj = Column(Numeric(32, 8), nullable=True)  ##柴油累计
    slzpdytb = Column(Numeric(32, 8), nullable=True)  ##塑料制品当月同比
    dyslzp = Column(Numeric(32, 8), nullable=True)  ##当月塑料制品
    slzpljtb = Column(Numeric(32, 8), nullable=True)  ##塑料制品累计同比
    slzplj = Column(Numeric(32, 8), nullable=True)  ##塑料制品累计
    gcdytb = Column(Numeric(32, 8), nullable=True)  ##钢材当月同比
    dygc = Column(Numeric(32, 8), nullable=True)  ##当月钢材
    gcljtb = Column(Numeric(32, 8), nullable=True)  ##钢材累计同比
    gclj = Column(Numeric(32, 8), nullable=True)  ##钢材累计
    create_time = Column(DateTime, nullable=False, default=datetime.datetime.now())
    update_time = Column(DateTime, nullable=False, default=datetime.datetime.now())
Index('cvm_hgsj_month_index', CVM_HGSJ_MONTH.date, unique=True)


class CVM_HGSJ_DAY(Base):
    __tablename__ = 'cvm_hgsj_day'
    id = Column(Integer, Sequence("seq_cvm_hgsj_day"), primary_key=True)
    date= Column(String(8), nullable=False)
    jktksjgzs = Column(Numeric(32,8), nullable=True) ##进口铁矿石价格指数
    gntksjgzs = Column(Numeric(32, 8), nullable=True)  ##国产铁矿石价格指数
    create_time = Column(DateTime, nullable=False, default=datetime.datetime.now())
    update_time = Column(DateTime, nullable=False, default=datetime.datetime.now())
Index('cvm_hgsj_day_index', CVM_HGSJ_DAY.date, unique=True)


class CVM_GNXFFW_MONTH(Base):
    __tablename__ = 'cvm_gnxffw_month'
    id = Column(Integer, Sequence("seq_cvm_gnxffw_month"), primary_key=True)
    date = Column(String(6), nullable=False)
    czxfzetbfx = Column(Numeric(32, 8), nullable=True)  ##城镇消费总额同比分析
    ncxfzetbfx = Column(Numeric(32, 8), nullable=True)  ##农村消费总额同比分析
    spfxkgmjtb = Column(Numeric(32, 8), nullable=True)  ##商品房新开工面积同比
    spfxkgmj = Column(Numeric(32, 8), nullable=True)  ##商品房新开工面积
    spfjgmjtb = Column(Numeric(32, 8), nullable=True)  ##商品房竣工面积同比
    spfjgmj = Column(Numeric(32, 8), nullable=True)  ##商品房竣工面积
    spfxsmjtb = Column(Numeric(32, 8), nullable=True)  ##商品房销量面积同比
    spfxsmj = Column(Numeric(32, 8), nullable=True)  ##商品房销量面积
    czxfze = Column(Numeric(32, 8), nullable=True)  ##城镇消费总额
    ncxfze = Column(Numeric(32, 8), nullable=True)  ##农村消费总额
    create_time = Column(DateTime, nullable=False, default=datetime.datetime.now())
    update_time = Column(DateTime, nullable=False, default=datetime.datetime.now())
Index('cvm_gnxffw_month_index', CVM_GNXFFW_MONTH.date, unique=True)